package com.hsp.Demo_12_enum;

import jdk.nashorn.internal.runtime.regexp.joni.constants.CCSTATE;

public class Demo_10 {
    public static void main(String[] args) {
//        System.out.println(Color.BLUE);
        showEnum(Color.RED);
        showEnum(Color.BLUE);
        showEnum(Color.BLACK);
        showEnum(Color.YELLOW);
        showEnum(Color.GREEN);
    }

    public static void showEnum(Color color){
        switch (color){
            case RED:
                System.out.println(color + "\t：" + Color.RED.show());
                break;
            case BLUE:
                System.out.println(color + "：" + Color.BLUE.show());
                break;
            case BLACK:
                System.out.println(color + "：" + Color.BLACK.show());
                break;
            case YELLOW:
                System.out.println(color + "：" + Color.YELLOW.show());
                break;
            case GREEN:
                System.out.println(color + "：" + Color.GREEN.show());
                break;
            default:
                System.out.println("无了");
        }
    }

}

interface Fater{
    String show();
}

enum Color implements Fater{
    RED(255,0,0),
    BLUE(0,0,255),
    BLACK(0,0,0),
    YELLOW(255,255,0),
    GREEN(0,255,0);

    private int redValue;
    private int greenValue;
    private int blueValue;

    private Color(int redValue, int greenValue, int blueValue){
        this.redValue = redValue;
        this.greenValue = greenValue;
        this.blueValue = blueValue;
    }


    @Override
    public String show() {
        return "{ redValue：" + redValue +
                ", greenValue：" + greenValue +
                ", blueValue：" + blueValue + " }";

    }
}